﻿using System;
using System.Collections.Generic;
using System.Text;
using TTServer.Objects;

using libReadWrite;
using libCommonClass;

namespace TTServer.Messages
{
    public class SignOutResponseMessage : TTMessage
    {
        private bool _result;

        public bool Result
        {
            get { return _result; }
            set { _result = value; }
        }

        private String _text;

        public String Text
        {
            get { return _text; }
            set { _text = value; }
        }

        public SignOutResponseMessage(bool result, String text)
        {
            this._result = result;
            this._text = text;
        }

        public SignOutResponseMessage()
        {
            // TODO: Complete member initialization
        }

        public override void ReadMessage(BigEndianReader sr)
        {
            throw new NotImplementedException();
        }

        public override void WriteMessage(BigEndianWriter sw)
        {
            sw.Write((byte)MessageKind.SIGNOUT_RESPONSE);
            sw.Write(Global.NO_LENGTH_CODE);

            sw.Write(_result == true ? 1 : 0);
            sw.WriteString(_text);
        }

        public override TTMessage Clone()
        {
            return new SignOutResponseMessage();
        }

        public override int GetMessageID()
        {
            return MessageKind.SIGNOUT_RESPONSE;
        }

        public override string GetMessageName()
        {
            return "SlideshowDataResponse";
        }
    }
}
